﻿using Microsoft.Phone.Controls;

namespace MoveObject
{
    public partial class MainPage : PhoneApplicationPage
    {
        private bool _beginned;
        
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void ForegroundEllipse_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
        {
            Mover.X = e.CumulativeManipulation.Translation.X;
            Mover.Y = e.CumulativeManipulation.Translation.Y;

            if (!_beginned)
            {
                _beginned = true;
                SbEllipse.Begin();
            }
        }

        private void BackgroundPanel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            _beginned = false;
            SbEllipse.Stop();
        }

    }
}